import 'package:camera/camera.dart';
import 'package:flutter/material.dart';
import 'package:flutter_frame/app/modules/home/biometric_identification/biometric_identification_controller.dart';
import 'package:get/get.dart';

class BiometricIdentificationWidget extends StatelessWidget {
  BiometricIdentificationWidget({super.key});

  final controller = Get.put(BiometricIdentificationController());

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('相机预览'),
        actions: [
          IconButton(
            icon: const Icon(Icons.camera_alt),
            onPressed: () async {
              controller.takePicture();
            },
          )
        ],
      ),
      body: GetBuilder(init: BiometricIdentificationController(), builder: (_) {
        return CameraPreview(controller.cameraController);
      }),
    );
  }
}
